<HTML><HEAD><TITLE>result(+OptionList)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(mode_analyser)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>result(+OptionList)</H1>
Produce the mode analysis results for predicates
   compiled into the calling context module.
<DL>
<DT><EM>OptionList</EM></DT>
<DD>List of Name:Value pairs
</DD>
</DL>
<H2>Description</H2>
<P>
   This predicate displays the suggested invocation modes for each predicate 
   compiled using the mode analyser into the calling context module. 
   The suggested mode annotations can be passed to the mode/1 directive for 
   the associated predicate. The predicate is a tool and as such can be 
   invoked for an arbitrary module using <TT>mode_analyser:result@Module</TT>.
   </P><P>
   OptionList may contain the following options:
   <DL><DT>
   <PRE>verbose (default:off)</PRE>
   <DD>If set to 'on', the mode analyser will print details of argument 
   invocation modes for each argument of every predicate compiled into 
   the module with the mode analyser.
   </DL></P></P><P>
   The possible argument modes produced for each argument of each 
   predicate are: 
   </P><P><PRE>
   +   The argument is instantiated, i.e. it is not a variable.
   </PRE></P><P><PRE>
   ++  The argument is ground.
   </PRE></P><P><PRE>
   -   The argument is not instantiated, it must be a free variable without 
       any constraints, especially it must not occur in any other argument 
       and it cannot be a suspending variable. 
   </PRE></P><P><PRE>
   *   The argument is an attributed variable that may have constraints 
       or is a suspending variable. This detail is not a valid argument mode
       to the mode/1 directive and is printed merely for interest. As a result
       the actual argument mode will appear as '?'.
   </PRE></P><P><PRE>
   ?   The mode is not known or it is neither of the above ones.
   </PRE></P><P>
   NOTE: It is imperative to understand that the results of mode analysis 
   are merely suggestions for the invocation modes of a predicate based on 
   runtime information. If there are potential predicate invocation modes 
   that were not exercised during runtime, the tool is unable to account 
   for them in its analysis. For the mode specifier '-' the mode analyser
   does not determine whether the variable occurs in any other argument
   (i.e. is aliased), this must be manually verified. 
   In summary, the programmer must verify that the suggested modes are correct 
   before using the directive in the code.  If the instantiation of the 
   predicate call violates its mode declaration, no exception is raised and 
   its behaviour is undefined.
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Fail Conditions</H3>
No predicates have been compiled with the mode analyser 
   into the calling context module.
<H3>Resatisfiable</H3>
no
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Calling context module is not instantiated
</DL>
<H2>Examples</H2>
<PRE>
   [eclipse 2]: nqueens(8, Qs).
   L = [1, 5, 8, 6, 3, 7, 2, 4]
   Yes (0.00s cpu, solution 1, maybe more) ?
   ...
   ...
   Yes (0.10s cpu)
   [eclipse 5]: mode_analyser:result([verbose:on]).

   Mode analysis for eclipse : nqueens / 2:
        Results for argument 1:
                -: 0    *: 0    +: 0    ++: 1
        Results for argument 2:
                -: 1    *: 0    +: 0    ++: 0

        nqueens(++, -)

   Mode analysis for eclipse : noattack / 2:
        Results for argument 1:
                -: 0    *: 8    +: 0    ++: 0
        Results for argument 2:
                -: 0    *: 0    +: 7    ++: 1

        noattack(?, ?)

   Mode analysis for eclipse : safe / 1:
        Results for argument 1:
                -: 0    *: 0    +: 8    ++: 0

        safe(+)

   Mode analysis for eclipse : noattack / 3:
        Results for argument 1:
                -: 0    *: 28   +: 0    ++: 0
        Results for argument 2:
                -: 0    *: 0    +: 28   ++: 0
        Results for argument 3:
                -: 0    *: 0    +: 0    ++: 28

        noattack(?, +, ++)

   Yes (0.00s cpu)</PRE>
<H2>See Also</H2>
<A HREF="../../lib/mode_analyser/analyse-1.html">analyse / 1</A>, <A HREF="../../lib/mode_analyser/result-0.html">result / 0</A>, <A HREF="../../lib/mode_analyser/reset-0.html">reset / 0</A>
</BODY></HTML>
